<?php

namespace App\Common\Http\Controller;

use App\ApiBaseController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;

class AreaController extends ApiBaseController
{
    /**
     * User: zhangchaoqun
     * DateTime: 2021/6/15 10:30 上午
     * Describe: 获取所有地区列表，根据JSON文件来读取
     * Version: V1.0
     */
    public function getAreaAll()
    {
        $path = config('his.area_file');
        if (!file_exists($path)) {
            return $this->error('地区参数获取失败');
        }
        $data = file_get_contents($path);
        return $this->success('获取成功', json_decode($data, true));
    }
}
